package cliente;

import java.util.Properties;
import javax.naming.Context;
import javax.naming.InitialContext;
import javax.naming.NamingException;
import fabrica.service.*;

public class Cliente {

	public static void main(String[] args) throws NamingException {
		//parametros
		Properties jndiProps = new Properties();
		jndiProps.put(Context.INITIAL_CONTEXT_FACTORY, "org.jboss.naming.remote.client.InitialContextFactory");
		jndiProps.put(Context.PROVIDER_URL,"remote://127.0.0.1:4447");

		 // This is an important property to set if you want to do EJB invocations via the remote-naming project
		 jndiProps.put("jboss.naming.client.ejb.context", true);
		 
		 // create a context passing these properties
		   Context context = null;
			context = new InitialContext(jndiProps);

		 
		 // lookup the bean
			//IFACADE iDeposito =(IFACADE)context.lookup("TPO_IA_Deposito1_EAR/TPO_IA_Deposito1/FACADEService!deposito.facade.IFACADE");
			IFabricaService iFabrica =  (IFabricaService) context.lookup("TPO_IA_Fabrica_EAR/TPO_IA_Fabrica/FabricaService!fabrica.service.IFabricaService");

		 
		 
		 
		 //PRUEBA FABRICA
		 String path = "C:\\IA_REPO\\SolicitudFabricacionJSON3.json";
		 iFabrica.recibirSolicitudFabricacion(path);
		 

	}

}
